<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>LCOV - code analysis - /usr/include/google/protobuf/wire_format_lite.h</title>
  <link rel="stylesheet" type="text/css" href="../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../../../index.html">top level</a> - <a href="index.html">usr/include/google/protobuf</a> - wire_format_lite.h<span style="font-size: 80%;"> (source / <a href="wire_format_lite.h.func-sort-c.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">code analysis</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">2</td>
            <td class="headerCovTableEntry">6</td>
            <td class="headerCovTableEntryLo">33.3 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2020-09-11 22:25:26</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntry">0</td>
            <td class="headerCovTableEntryHi">-</td>
          </tr>
          <tr>
            <td class="headerItem">Legend:</td>
            <td class="headerValueLeg">            Lines:
            <span class="coverLegendCov">hit</span>
            <span class="coverLegendNoCov">not hit</span>
</td>
            <td></td>
          </tr>
          <tr><td><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">          Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>            : // Protocol Buffers - Google's data interchange format</a>
<span class="lineNum">       2 </span>            : // Copyright 2008 Google Inc.  All rights reserved.
<span class="lineNum">       3 </span>            : // https://developers.google.com/protocol-buffers/
<span class="lineNum">       4 </span>            : //
<span class="lineNum">       5 </span>            : // Redistribution and use in source and binary forms, with or without
<span class="lineNum">       6 </span>            : // modification, are permitted provided that the following conditions are
<span class="lineNum">       7 </span>            : // met:
<span class="lineNum">       8 </span>            : //
<span class="lineNum">       9 </span>            : //     * Redistributions of source code must retain the above copyright
<span class="lineNum">      10 </span>            : // notice, this list of conditions and the following disclaimer.
<span class="lineNum">      11 </span>            : //     * Redistributions in binary form must reproduce the above
<span class="lineNum">      12 </span>            : // copyright notice, this list of conditions and the following disclaimer
<span class="lineNum">      13 </span>            : // in the documentation and/or other materials provided with the
<span class="lineNum">      14 </span>            : // distribution.
<span class="lineNum">      15 </span>            : //     * Neither the name of Google Inc. nor the names of its
<span class="lineNum">      16 </span>            : // contributors may be used to endorse or promote products derived from
<span class="lineNum">      17 </span>            : // this software without specific prior written permission.
<span class="lineNum">      18 </span>            : //
<span class="lineNum">      19 </span>            : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
<span class="lineNum">      20 </span>            : // &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
<span class="lineNum">      21 </span>            : // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
<span class="lineNum">      22 </span>            : // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
<span class="lineNum">      23 </span>            : // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
<span class="lineNum">      24 </span>            : // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<span class="lineNum">      25 </span>            : // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
<span class="lineNum">      26 </span>            : // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
<span class="lineNum">      27 </span>            : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class="lineNum">      28 </span>            : // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<span class="lineNum">      29 </span>            : // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class="lineNum">      30 </span>            : 
<span class="lineNum">      31 </span>            : // Author: kenton@google.com (Kenton Varda)
<span class="lineNum">      32 </span>            : //         atenasio@google.com (Chris Atenasio) (ZigZag transform)
<span class="lineNum">      33 </span>            : //         wink@google.com (Wink Saville) (refactored from wire_format.h)
<span class="lineNum">      34 </span>            : //  Based on original Protocol Buffers design by
<span class="lineNum">      35 </span>            : //  Sanjay Ghemawat, Jeff Dean, and others.
<span class="lineNum">      36 </span>            : //
<span class="lineNum">      37 </span>            : // This header is logically internal, but is made public because it is used
<span class="lineNum">      38 </span>            : // from protocol-compiler-generated code, which may reside in other components.
<span class="lineNum">      39 </span>            : 
<span class="lineNum">      40 </span>            : #ifndef GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
<span class="lineNum">      41 </span>            : #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
<span class="lineNum">      42 </span>            : 
<span class="lineNum">      43 </span>            : #include &lt;string&gt;
<span class="lineNum">      44 </span>            : #include &lt;google/protobuf/stubs/common.h&gt;
<span class="lineNum">      45 </span>            : #include &lt;google/protobuf/message_lite.h&gt;
<span class="lineNum">      46 </span>            : #include &lt;google/protobuf/io/coded_stream.h&gt;  // for CodedOutputStream::Varint32Size
<span class="lineNum">      47 </span>            : 
<span class="lineNum">      48 </span>            : namespace google {
<span class="lineNum">      49 </span>            : 
<span class="lineNum">      50 </span>            : namespace protobuf {
<span class="lineNum">      51 </span>            :   template &lt;typename T&gt; class RepeatedField;  // repeated_field.h
<span class="lineNum">      52 </span>            : }
<span class="lineNum">      53 </span>            : 
<span class="lineNum">      54 </span>            : namespace protobuf {
<span class="lineNum">      55 </span>            : namespace internal {
<span class="lineNum">      56 </span>            : 
<span class="lineNum">      57 </span>            : class StringPieceField;
<span class="lineNum">      58 </span>            : 
<span class="lineNum">      59 </span>            : // This class is for internal use by the protocol buffer library and by
<span class="lineNum">      60 </span>            : // protocol-complier-generated message classes.  It must not be called
<span class="lineNum">      61 </span>            : // directly by clients.
<span class="lineNum">      62 </span>            : //
<span class="lineNum">      63 </span>            : // This class contains helpers for implementing the binary protocol buffer
<span class="lineNum">      64 </span>            : // wire format without the need for reflection. Use WireFormat when using
<span class="lineNum">      65 </span>            : // reflection.
<span class="lineNum">      66 </span>            : //
<span class="lineNum">      67 </span>            : // This class is really a namespace that contains only static methods.
<span class="lineNum">      68 </span>            : class LIBPROTOBUF_EXPORT WireFormatLite {
<span class="lineNum">      69 </span>            :  public:
<span class="lineNum">      70 </span>            : 
<span class="lineNum">      71 </span>            :   // -----------------------------------------------------------------
<span class="lineNum">      72 </span>            :   // Helper constants and functions related to the format.  These are
<span class="lineNum">      73 </span>            :   // mostly meant for internal and generated code to use.
<span class="lineNum">      74 </span>            : 
<span class="lineNum">      75 </span>            :   // The wire format is composed of a sequence of tag/value pairs, each
<span class="lineNum">      76 </span>            :   // of which contains the value of one field (or one element of a repeated
<span class="lineNum">      77 </span>            :   // field).  Each tag is encoded as a varint.  The lower bits of the tag
<span class="lineNum">      78 </span>            :   // identify its wire type, which specifies the format of the data to follow.
<span class="lineNum">      79 </span>            :   // The rest of the bits contain the field number.  Each type of field (as
<span class="lineNum">      80 </span>            :   // declared by FieldDescriptor::Type, in descriptor.h) maps to one of
<span class="lineNum">      81 </span>            :   // these wire types.  Immediately following each tag is the field's value,
<span class="lineNum">      82 </span>            :   // encoded in the format specified by the wire type.  Because the tag
<span class="lineNum">      83 </span>            :   // identifies the encoding of this data, it is possible to skip
<span class="lineNum">      84 </span>            :   // unrecognized fields for forwards compatibility.
<span class="lineNum">      85 </span>            : 
<span class="lineNum">      86 </span>            :   enum WireType {
<span class="lineNum">      87 </span>            :     WIRETYPE_VARINT           = 0,
<span class="lineNum">      88 </span>            :     WIRETYPE_FIXED64          = 1,
<span class="lineNum">      89 </span>            :     WIRETYPE_LENGTH_DELIMITED = 2,
<span class="lineNum">      90 </span>            :     WIRETYPE_START_GROUP      = 3,
<span class="lineNum">      91 </span>            :     WIRETYPE_END_GROUP        = 4,
<span class="lineNum">      92 </span>            :     WIRETYPE_FIXED32          = 5,
<span class="lineNum">      93 </span>            :   };
<span class="lineNum">      94 </span>            : 
<span class="lineNum">      95 </span>            :   // Lite alternative to FieldDescriptor::Type.  Must be kept in sync.
<span class="lineNum">      96 </span>            :   enum FieldType {
<span class="lineNum">      97 </span>            :     TYPE_DOUBLE         = 1,
<span class="lineNum">      98 </span>            :     TYPE_FLOAT          = 2,
<span class="lineNum">      99 </span>            :     TYPE_INT64          = 3,
<span class="lineNum">     100 </span>            :     TYPE_UINT64         = 4,
<span class="lineNum">     101 </span>            :     TYPE_INT32          = 5,
<span class="lineNum">     102 </span>            :     TYPE_FIXED64        = 6,
<span class="lineNum">     103 </span>            :     TYPE_FIXED32        = 7,
<span class="lineNum">     104 </span>            :     TYPE_BOOL           = 8,
<span class="lineNum">     105 </span>            :     TYPE_STRING         = 9,
<span class="lineNum">     106 </span>            :     TYPE_GROUP          = 10,
<span class="lineNum">     107 </span>            :     TYPE_MESSAGE        = 11,
<span class="lineNum">     108 </span>            :     TYPE_BYTES          = 12,
<span class="lineNum">     109 </span>            :     TYPE_UINT32         = 13,
<span class="lineNum">     110 </span>            :     TYPE_ENUM           = 14,
<span class="lineNum">     111 </span>            :     TYPE_SFIXED32       = 15,
<span class="lineNum">     112 </span>            :     TYPE_SFIXED64       = 16,
<span class="lineNum">     113 </span>            :     TYPE_SINT32         = 17,
<span class="lineNum">     114 </span>            :     TYPE_SINT64         = 18,
<span class="lineNum">     115 </span>            :     MAX_FIELD_TYPE      = 18,
<span class="lineNum">     116 </span>            :   };
<span class="lineNum">     117 </span>            : 
<span class="lineNum">     118 </span>            :   // Lite alternative to FieldDescriptor::CppType.  Must be kept in sync.
<span class="lineNum">     119 </span>            :   enum CppType {
<span class="lineNum">     120 </span>            :     CPPTYPE_INT32       = 1,
<span class="lineNum">     121 </span>            :     CPPTYPE_INT64       = 2,
<span class="lineNum">     122 </span>            :     CPPTYPE_UINT32      = 3,
<span class="lineNum">     123 </span>            :     CPPTYPE_UINT64      = 4,
<span class="lineNum">     124 </span>            :     CPPTYPE_DOUBLE      = 5,
<span class="lineNum">     125 </span>            :     CPPTYPE_FLOAT       = 6,
<span class="lineNum">     126 </span>            :     CPPTYPE_BOOL        = 7,
<span class="lineNum">     127 </span>            :     CPPTYPE_ENUM        = 8,
<span class="lineNum">     128 </span>            :     CPPTYPE_STRING      = 9,
<span class="lineNum">     129 </span>            :     CPPTYPE_MESSAGE     = 10,
<span class="lineNum">     130 </span>            :     MAX_CPPTYPE         = 10,
<span class="lineNum">     131 </span>            :   };
<span class="lineNum">     132 </span>            : 
<span class="lineNum">     133 </span>            :   // Helper method to get the CppType for a particular Type.
<span class="lineNum">     134 </span>            :   static CppType FieldTypeToCppType(FieldType type);
<span class="lineNum">     135 </span>            : 
<span class="lineNum">     136 </span>            :   // Given a FieldSescriptor::Type return its WireType
<span class="lineNum">     137 </span>            :   static inline WireFormatLite::WireType WireTypeForFieldType(
<span class="lineNum">     138 </span>            :       WireFormatLite::FieldType type) {
<span class="lineNum">     139 </span>            :     return kWireTypeForFieldType[type];
<span class="lineNum">     140 </span>            :   }
<span class="lineNum">     141 </span>            : 
<span class="lineNum">     142 </span>            :   // Number of bits in a tag which identify the wire type.
<span class="lineNum">     143 </span>            :   static const int kTagTypeBits = 3;
<span class="lineNum">     144 </span>            :   // Mask for those bits.
<span class="lineNum">     145 </span>            :   static const uint32 kTagTypeMask = (1 &lt;&lt; kTagTypeBits) - 1;
<span class="lineNum">     146 </span>            : 
<span class="lineNum">     147 </span>            :   // Helper functions for encoding and decoding tags.  (Inlined below and in
<span class="lineNum">     148 </span>            :   // _inl.h)
<span class="lineNum">     149 </span>            :   //
<span class="lineNum">     150 </span>            :   // This is different from MakeTag(field-&gt;number(), field-&gt;type()) in the case
<span class="lineNum">     151 </span>            :   // of packed repeated fields.
<span class="lineNum">     152 </span>            :   static uint32 MakeTag(int field_number, WireType type);
<span class="lineNum">     153 </span>            :   static WireType GetTagWireType(uint32 tag);
<span class="lineNum">     154 </span>            :   static int GetTagFieldNumber(uint32 tag);
<span class="lineNum">     155 </span>            : 
<span class="lineNum">     156 </span>            :   // Compute the byte size of a tag.  For groups, this includes both the start
<span class="lineNum">     157 </span>            :   // and end tags.
<span class="lineNum">     158 </span>            :   static inline int TagSize(int field_number, WireFormatLite::FieldType type);
<span class="lineNum">     159 </span>            : 
<span class="lineNum">     160 </span>            :   // Skips a field value with the given tag.  The input should start
<span class="lineNum">     161 </span>            :   // positioned immediately after the tag.  Skipped values are simply discarded,
<span class="lineNum">     162 </span>            :   // not recorded anywhere.  See WireFormat::SkipField() for a version that
<span class="lineNum">     163 </span>            :   // records to an UnknownFieldSet.
<span class="lineNum">     164 </span>            :   static bool SkipField(io::CodedInputStream* input, uint32 tag);
<span class="lineNum">     165 </span>            : 
<span class="lineNum">     166 </span>            :   // Skips a field value with the given tag.  The input should start
<span class="lineNum">     167 </span>            :   // positioned immediately after the tag. Skipped values are recorded to a
<span class="lineNum">     168 </span>            :   // CodedOutputStream.
<span class="lineNum">     169 </span>            :   static bool SkipField(io::CodedInputStream* input, uint32 tag,
<span class="lineNum">     170 </span>            :                         io::CodedOutputStream* output);
<span class="lineNum">     171 </span>            : 
<span class="lineNum">     172 </span>            :   // Reads and ignores a message from the input.  Skipped values are simply
<span class="lineNum">     173 </span>            :   // discarded, not recorded anywhere.  See WireFormat::SkipMessage() for a
<span class="lineNum">     174 </span>            :   // version that records to an UnknownFieldSet.
<span class="lineNum">     175 </span>            :   static bool SkipMessage(io::CodedInputStream* input);
<span class="lineNum">     176 </span>            : 
<span class="lineNum">     177 </span>            :   // Reads and ignores a message from the input.  Skipped values are recorded
<span class="lineNum">     178 </span>            :   // to a CodedOutputStream.
<span class="lineNum">     179 </span>            :   static bool SkipMessage(io::CodedInputStream* input,
<span class="lineNum">     180 </span>            :                           io::CodedOutputStream* output);
<span class="lineNum">     181 </span>            : 
<span class="lineNum">     182 </span>            : // This macro does the same thing as WireFormatLite::MakeTag(), but the
<span class="lineNum">     183 </span>            : // result is usable as a compile-time constant, which makes it usable
<span class="lineNum">     184 </span>            : // as a switch case or a template input.  WireFormatLite::MakeTag() is more
<span class="lineNum">     185 </span>            : // type-safe, though, so prefer it if possible.
<span class="lineNum">     186 </span>            : #define GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(FIELD_NUMBER, TYPE)                  \
<span class="lineNum">     187 </span>            :   static_cast&lt;uint32&gt;(                                                   \
<span class="lineNum">     188 </span>            :     ((FIELD_NUMBER) &lt;&lt; ::google::protobuf::internal::WireFormatLite::kTagTypeBits) \
<span class="lineNum">     189 </span>            :       | (TYPE))
<span class="lineNum">     190 </span>            : 
<span class="lineNum">     191 </span>            :   // These are the tags for the old MessageSet format, which was defined as:
<span class="lineNum">     192 </span>            :   //   message MessageSet {
<span class="lineNum">     193 </span>            :   //     repeated group Item = 1 {
<span class="lineNum">     194 </span>            :   //       required int32 type_id = 2;
<span class="lineNum">     195 </span>            :   //       required string message = 3;
<span class="lineNum">     196 </span>            :   //     }
<span class="lineNum">     197 </span>            :   //   }
<span class="lineNum">     198 </span>            :   static const int kMessageSetItemNumber = 1;
<span class="lineNum">     199 </span>            :   static const int kMessageSetTypeIdNumber = 2;
<span class="lineNum">     200 </span>            :   static const int kMessageSetMessageNumber = 3;
<span class="lineNum">     201 </span>            :   static const int kMessageSetItemStartTag =
<span class="lineNum">     202 </span>            :     GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,
<span class="lineNum">     203 </span>            :                                 WireFormatLite::WIRETYPE_START_GROUP);
<span class="lineNum">     204 </span>            :   static const int kMessageSetItemEndTag =
<span class="lineNum">     205 </span>            :     GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetItemNumber,
<span class="lineNum">     206 </span>            :                                 WireFormatLite::WIRETYPE_END_GROUP);
<span class="lineNum">     207 </span>            :   static const int kMessageSetTypeIdTag =
<span class="lineNum">     208 </span>            :     GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetTypeIdNumber,
<span class="lineNum">     209 </span>            :                                 WireFormatLite::WIRETYPE_VARINT);
<span class="lineNum">     210 </span>            :   static const int kMessageSetMessageTag =
<span class="lineNum">     211 </span>            :     GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(kMessageSetMessageNumber,
<span class="lineNum">     212 </span>            :                                 WireFormatLite::WIRETYPE_LENGTH_DELIMITED);
<span class="lineNum">     213 </span>            : 
<span class="lineNum">     214 </span>            :   // Byte size of all tags of a MessageSet::Item combined.
<span class="lineNum">     215 </span>            :   static const int kMessageSetItemTagsSize;
<span class="lineNum">     216 </span>            : 
<span class="lineNum">     217 </span>            :   // Helper functions for converting between floats/doubles and IEEE-754
<span class="lineNum">     218 </span>            :   // uint32s/uint64s so that they can be written.  (Assumes your platform
<span class="lineNum">     219 </span>            :   // uses IEEE-754 floats.)
<span class="lineNum">     220 </span>            :   static uint32 EncodeFloat(float value);
<span class="lineNum">     221 </span>            :   static float DecodeFloat(uint32 value);
<span class="lineNum">     222 </span>            :   static uint64 EncodeDouble(double value);
<span class="lineNum">     223 </span>            :   static double DecodeDouble(uint64 value);
<span class="lineNum">     224 </span>            : 
<span class="lineNum">     225 </span>            :   // Helper functions for mapping signed integers to unsigned integers in
<span class="lineNum">     226 </span>            :   // such a way that numbers with small magnitudes will encode to smaller
<span class="lineNum">     227 </span>            :   // varints.  If you simply static_cast a negative number to an unsigned
<span class="lineNum">     228 </span>            :   // number and varint-encode it, it will always take 10 bytes, defeating
<span class="lineNum">     229 </span>            :   // the purpose of varint.  So, for the &quot;sint32&quot; and &quot;sint64&quot; field types,
<span class="lineNum">     230 </span>            :   // we ZigZag-encode the values.
<span class="lineNum">     231 </span>            :   static uint32 ZigZagEncode32(int32 n);
<span class="lineNum">     232 </span>            :   static int32  ZigZagDecode32(uint32 n);
<span class="lineNum">     233 </span>            :   static uint64 ZigZagEncode64(int64 n);
<span class="lineNum">     234 </span>            :   static int64  ZigZagDecode64(uint64 n);
<span class="lineNum">     235 </span>            : 
<span class="lineNum">     236 </span>            :   // =================================================================
<span class="lineNum">     237 </span>            :   // Methods for reading/writing individual field.  The implementations
<span class="lineNum">     238 </span>            :   // of these methods are defined in wire_format_lite_inl.h; you must #include
<span class="lineNum">     239 </span>            :   // that file to use these.
<span class="lineNum">     240 </span>            : 
<span class="lineNum">     241 </span>            : // Avoid ugly line wrapping
<span class="lineNum">     242 </span>            : #define input  io::CodedInputStream*  input_arg
<span class="lineNum">     243 </span>            : #define output io::CodedOutputStream* output_arg
<span class="lineNum">     244 </span>            : #define field_number int field_number_arg
<span class="lineNum">     245 </span>            : #define INL GOOGLE_ATTRIBUTE_ALWAYS_INLINE
<span class="lineNum">     246 </span>            : 
<span class="lineNum">     247 </span>            :   // Read fields, not including tags.  The assumption is that you already
<span class="lineNum">     248 </span>            :   // read the tag to determine what field to read.
<span class="lineNum">     249 </span>            : 
<span class="lineNum">     250 </span>            :   // For primitive fields, we just use a templatized routine parameterized by
<span class="lineNum">     251 </span>            :   // the represented type and the FieldType. These are specialized with the
<span class="lineNum">     252 </span>            :   // appropriate definition for each declared type.
<span class="lineNum">     253 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     254 </span>            :   static inline bool ReadPrimitive(input, CType* value) INL;
<span class="lineNum">     255 </span>            : 
<span class="lineNum">     256 </span>            :   // Reads repeated primitive values, with optimizations for repeats.
<span class="lineNum">     257 </span>            :   // tag_size and tag should both be compile-time constants provided by the
<span class="lineNum">     258 </span>            :   // protocol compiler.
<span class="lineNum">     259 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     260 </span>            :   static inline bool ReadRepeatedPrimitive(int tag_size,
<span class="lineNum">     261 </span>            :                                            uint32 tag,
<span class="lineNum">     262 </span>            :                                            input,
<span class="lineNum">     263 </span>            :                                            RepeatedField&lt;CType&gt;* value) INL;
<span class="lineNum">     264 </span>            : 
<span class="lineNum">     265 </span>            :   // Identical to ReadRepeatedPrimitive, except will not inline the
<span class="lineNum">     266 </span>            :   // implementation.
<span class="lineNum">     267 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     268 </span>            :   static bool ReadRepeatedPrimitiveNoInline(int tag_size,
<span class="lineNum">     269 </span>            :                                             uint32 tag,
<span class="lineNum">     270 </span>            :                                             input,
<span class="lineNum">     271 </span>            :                                             RepeatedField&lt;CType&gt;* value);
<span class="lineNum">     272 </span>            : 
<span class="lineNum">     273 </span>            :   // Reads a primitive value directly from the provided buffer. It returns a
<span class="lineNum">     274 </span>            :   // pointer past the segment of data that was read.
<span class="lineNum">     275 </span>            :   //
<span class="lineNum">     276 </span>            :   // This is only implemented for the types with fixed wire size, e.g.
<span class="lineNum">     277 </span>            :   // float, double, and the (s)fixed* types.
<span class="lineNum">     278 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     279 </span>            :   static inline const uint8* ReadPrimitiveFromArray(const uint8* buffer,
<span class="lineNum">     280 </span>            :                                                     CType* value) INL;
<span class="lineNum">     281 </span>            : 
<span class="lineNum">     282 </span>            :   // Reads a primitive packed field.
<span class="lineNum">     283 </span>            :   //
<span class="lineNum">     284 </span>            :   // This is only implemented for packable types.
<span class="lineNum">     285 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     286 </span>            :   static inline bool ReadPackedPrimitive(input,
<span class="lineNum">     287 </span>            :                                          RepeatedField&lt;CType&gt;* value) INL;
<span class="lineNum">     288 </span>            : 
<span class="lineNum">     289 </span>            :   // Identical to ReadPackedPrimitive, except will not inline the
<span class="lineNum">     290 </span>            :   // implementation.
<span class="lineNum">     291 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     292 </span>            :   static bool ReadPackedPrimitiveNoInline(input, RepeatedField&lt;CType&gt;* value);
<span class="lineNum">     293 </span>            : 
<span class="lineNum">     294 </span>            :   // Read a packed enum field. Values for which is_valid() returns false are
<span class="lineNum">     295 </span>            :   // dropped.
<span class="lineNum">     296 </span>            :   static bool ReadPackedEnumNoInline(input,
<span class="lineNum">     297 </span>            :                                      bool (*is_valid)(int),
<span class="lineNum">     298 </span>            :                                      RepeatedField&lt;int&gt;* value);
<span class="lineNum">     299 </span>            : 
<span class="lineNum">     300 </span>            :   static bool ReadString(input, string* value);
<span class="lineNum">     301 </span>            :   static bool ReadBytes (input, string* value);
<span class="lineNum">     302 </span>            : 
<span class="lineNum">     303 </span>            :   static inline bool ReadGroup  (field_number, input, MessageLite* value);
<span class="lineNum">     304 </span>            :   static inline bool ReadMessage(input, MessageLite* value);
<span class="lineNum">     305 </span>            : 
<span class="lineNum">     306 </span>            :   // Like above, but de-virtualize the call to MergePartialFromCodedStream().
<span class="lineNum">     307 </span>            :   // The pointer must point at an instance of MessageType, *not* a subclass (or
<span class="lineNum">     308 </span>            :   // the subclass must not override MergePartialFromCodedStream()).
<span class="lineNum">     309 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     310 </span>            :   static inline bool ReadGroupNoVirtual(field_number, input,
<span class="lineNum">     311 </span>            :                                         MessageType* value);
<span class="lineNum">     312 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     313 </span>            :   static inline bool ReadMessageNoVirtual(input, MessageType* value);
<span class="lineNum">     314 </span>            : 
<span class="lineNum">     315 </span>            :   // Write a tag.  The Write*() functions typically include the tag, so
<span class="lineNum">     316 </span>            :   // normally there's no need to call this unless using the Write*NoTag()
<span class="lineNum">     317 </span>            :   // variants.
<span class="lineNum">     318 </span>            :   static inline void WriteTag(field_number, WireType type, output) INL;
<span class="lineNum">     319 </span>            : 
<span class="lineNum">     320 </span>            :   // Write fields, without tags.
<span class="lineNum">     321 </span>            :   static inline void WriteInt32NoTag   (int32 value, output) INL;
<span class="lineNum">     322 </span>            :   static inline void WriteInt64NoTag   (int64 value, output) INL;
<span class="lineNum">     323 </span>            :   static inline void WriteUInt32NoTag  (uint32 value, output) INL;
<span class="lineNum">     324 </span>            :   static inline void WriteUInt64NoTag  (uint64 value, output) INL;
<span class="lineNum">     325 </span>            :   static inline void WriteSInt32NoTag  (int32 value, output) INL;
<span class="lineNum">     326 </span>            :   static inline void WriteSInt64NoTag  (int64 value, output) INL;
<span class="lineNum">     327 </span>            :   static inline void WriteFixed32NoTag (uint32 value, output) INL;
<span class="lineNum">     328 </span>            :   static inline void WriteFixed64NoTag (uint64 value, output) INL;
<span class="lineNum">     329 </span>            :   static inline void WriteSFixed32NoTag(int32 value, output) INL;
<span class="lineNum">     330 </span>            :   static inline void WriteSFixed64NoTag(int64 value, output) INL;
<span class="lineNum">     331 </span>            :   static inline void WriteFloatNoTag   (float value, output) INL;
<span class="lineNum">     332 </span>            :   static inline void WriteDoubleNoTag  (double value, output) INL;
<span class="lineNum">     333 </span>            :   static inline void WriteBoolNoTag    (bool value, output) INL;
<span class="lineNum">     334 </span>            :   static inline void WriteEnumNoTag    (int value, output) INL;
<span class="lineNum">     335 </span>            : 
<span class="lineNum">     336 </span>            :   // Write fields, including tags.
<span class="lineNum">     337 </span>            :   static void WriteInt32   (field_number,  int32 value, output);
<span class="lineNum">     338 </span>            :   static void WriteInt64   (field_number,  int64 value, output);
<span class="lineNum">     339 </span>            :   static void WriteUInt32  (field_number, uint32 value, output);
<span class="lineNum">     340 </span>            :   static void WriteUInt64  (field_number, uint64 value, output);
<span class="lineNum">     341 </span>            :   static void WriteSInt32  (field_number,  int32 value, output);
<span class="lineNum">     342 </span>            :   static void WriteSInt64  (field_number,  int64 value, output);
<span class="lineNum">     343 </span>            :   static void WriteFixed32 (field_number, uint32 value, output);
<span class="lineNum">     344 </span>            :   static void WriteFixed64 (field_number, uint64 value, output);
<span class="lineNum">     345 </span>            :   static void WriteSFixed32(field_number,  int32 value, output);
<span class="lineNum">     346 </span>            :   static void WriteSFixed64(field_number,  int64 value, output);
<span class="lineNum">     347 </span>            :   static void WriteFloat   (field_number,  float value, output);
<span class="lineNum">     348 </span>            :   static void WriteDouble  (field_number, double value, output);
<span class="lineNum">     349 </span>            :   static void WriteBool    (field_number,   bool value, output);
<span class="lineNum">     350 </span>            :   static void WriteEnum    (field_number,    int value, output);
<span class="lineNum">     351 </span>            : 
<span class="lineNum">     352 </span>            :   static void WriteString(field_number, const string&amp; value, output);
<span class="lineNum">     353 </span>            :   static void WriteBytes (field_number, const string&amp; value, output);
<span class="lineNum">     354 </span>            :   static void WriteStringMaybeAliased(
<span class="lineNum">     355 </span>            :       field_number, const string&amp; value, output);
<span class="lineNum">     356 </span>            :   static void WriteBytesMaybeAliased(
<span class="lineNum">     357 </span>            :       field_number, const string&amp; value, output);
<span class="lineNum">     358 </span>            : 
<span class="lineNum">     359 </span>            :   static void WriteGroup(
<span class="lineNum">     360 </span>            :     field_number, const MessageLite&amp; value, output);
<span class="lineNum">     361 </span>            :   static void WriteMessage(
<span class="lineNum">     362 </span>            :     field_number, const MessageLite&amp; value, output);
<span class="lineNum">     363 </span>            :   // Like above, but these will check if the output stream has enough
<span class="lineNum">     364 </span>            :   // space to write directly to a flat array.
<span class="lineNum">     365 </span>            :   static void WriteGroupMaybeToArray(
<span class="lineNum">     366 </span>            :     field_number, const MessageLite&amp; value, output);
<span class="lineNum">     367 </span>            :   static void WriteMessageMaybeToArray(
<span class="lineNum">     368 </span>            :     field_number, const MessageLite&amp; value, output);
<span class="lineNum">     369 </span>            : 
<span class="lineNum">     370 </span>            :   // Like above, but de-virtualize the call to SerializeWithCachedSizes().  The
<span class="lineNum">     371 </span>            :   // pointer must point at an instance of MessageType, *not* a subclass (or
<span class="lineNum">     372 </span>            :   // the subclass must not override SerializeWithCachedSizes()).
<span class="lineNum">     373 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     374 </span>            :   static inline void WriteGroupNoVirtual(
<span class="lineNum">     375 </span>            :     field_number, const MessageType&amp; value, output);
<span class="lineNum">     376 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     377 </span>            :   static inline void WriteMessageNoVirtual(
<span class="lineNum">     378 </span>            :     field_number, const MessageType&amp; value, output);
<span class="lineNum">     379 </span>            : 
<span class="lineNum">     380 </span>            : #undef output
<span class="lineNum">     381 </span>            : #define output uint8* target
<span class="lineNum">     382 </span>            : 
<span class="lineNum">     383 </span>            :   // Like above, but use only *ToArray methods of CodedOutputStream.
<span class="lineNum">     384 </span>            :   static inline uint8* WriteTagToArray(field_number, WireType type, output) INL;
<span class="lineNum">     385 </span>            : 
<span class="lineNum">     386 </span>            :   // Write fields, without tags.
<span class="lineNum">     387 </span>            :   static inline uint8* WriteInt32NoTagToArray   (int32 value, output) INL;
<span class="lineNum">     388 </span>            :   static inline uint8* WriteInt64NoTagToArray   (int64 value, output) INL;
<span class="lineNum">     389 </span>            :   static inline uint8* WriteUInt32NoTagToArray  (uint32 value, output) INL;
<span class="lineNum">     390 </span>            :   static inline uint8* WriteUInt64NoTagToArray  (uint64 value, output) INL;
<span class="lineNum">     391 </span>            :   static inline uint8* WriteSInt32NoTagToArray  (int32 value, output) INL;
<span class="lineNum">     392 </span>            :   static inline uint8* WriteSInt64NoTagToArray  (int64 value, output) INL;
<span class="lineNum">     393 </span>            :   static inline uint8* WriteFixed32NoTagToArray (uint32 value, output) INL;
<span class="lineNum">     394 </span>            :   static inline uint8* WriteFixed64NoTagToArray (uint64 value, output) INL;
<span class="lineNum">     395 </span>            :   static inline uint8* WriteSFixed32NoTagToArray(int32 value, output) INL;
<span class="lineNum">     396 </span>            :   static inline uint8* WriteSFixed64NoTagToArray(int64 value, output) INL;
<span class="lineNum">     397 </span>            :   static inline uint8* WriteFloatNoTagToArray   (float value, output) INL;
<span class="lineNum">     398 </span>            :   static inline uint8* WriteDoubleNoTagToArray  (double value, output) INL;
<span class="lineNum">     399 </span>            :   static inline uint8* WriteBoolNoTagToArray    (bool value, output) INL;
<span class="lineNum">     400 </span>            :   static inline uint8* WriteEnumNoTagToArray    (int value, output) INL;
<span class="lineNum">     401 </span>            : 
<span class="lineNum">     402 </span>            :   // Write fields, including tags.
<span class="lineNum">     403 </span>            :   static inline uint8* WriteInt32ToArray(
<span class="lineNum">     404 </span>            :     field_number, int32 value, output) INL;
<span class="lineNum">     405 </span>            :   static inline uint8* WriteInt64ToArray(
<span class="lineNum">     406 </span>            :     field_number, int64 value, output) INL;
<span class="lineNum">     407 </span>            :   static inline uint8* WriteUInt32ToArray(
<span class="lineNum">     408 </span>            :     field_number, uint32 value, output) INL;
<span class="lineNum">     409 </span>            :   static inline uint8* WriteUInt64ToArray(
<span class="lineNum">     410 </span>            :     field_number, uint64 value, output) INL;
<span class="lineNum">     411 </span>            :   static inline uint8* WriteSInt32ToArray(
<span class="lineNum">     412 </span>            :     field_number, int32 value, output) INL;
<span class="lineNum">     413 </span>            :   static inline uint8* WriteSInt64ToArray(
<span class="lineNum">     414 </span>            :     field_number, int64 value, output) INL;
<span class="lineNum">     415 </span>            :   static inline uint8* WriteFixed32ToArray(
<span class="lineNum">     416 </span>            :     field_number, uint32 value, output) INL;
<span class="lineNum">     417 </span>            :   static inline uint8* WriteFixed64ToArray(
<span class="lineNum">     418 </span>            :     field_number, uint64 value, output) INL;
<span class="lineNum">     419 </span>            :   static inline uint8* WriteSFixed32ToArray(
<span class="lineNum">     420 </span>            :     field_number, int32 value, output) INL;
<span class="lineNum">     421 </span>            :   static inline uint8* WriteSFixed64ToArray(
<span class="lineNum">     422 </span>            :     field_number, int64 value, output) INL;
<span class="lineNum">     423 </span>            :   static inline uint8* WriteFloatToArray(
<span class="lineNum">     424 </span>            :     field_number, float value, output) INL;
<span class="lineNum">     425 </span>            :   static inline uint8* WriteDoubleToArray(
<span class="lineNum">     426 </span>            :     field_number, double value, output) INL;
<span class="lineNum">     427 </span>            :   static inline uint8* WriteBoolToArray(
<span class="lineNum">     428 </span>            :     field_number, bool value, output) INL;
<span class="lineNum">     429 </span>            :   static inline uint8* WriteEnumToArray(
<span class="lineNum">     430 </span>            :     field_number, int value, output) INL;
<span class="lineNum">     431 </span>            : 
<span class="lineNum">     432 </span>            :   static inline uint8* WriteStringToArray(
<span class="lineNum">     433 </span>            :     field_number, const string&amp; value, output) INL;
<span class="lineNum">     434 </span>            :   static inline uint8* WriteBytesToArray(
<span class="lineNum">     435 </span>            :     field_number, const string&amp; value, output) INL;
<span class="lineNum">     436 </span>            : 
<span class="lineNum">     437 </span>            :   static inline uint8* WriteGroupToArray(
<span class="lineNum">     438 </span>            :       field_number, const MessageLite&amp; value, output) INL;
<span class="lineNum">     439 </span>            :   static inline uint8* WriteMessageToArray(
<span class="lineNum">     440 </span>            :       field_number, const MessageLite&amp; value, output) INL;
<span class="lineNum">     441 </span>            : 
<span class="lineNum">     442 </span>            :   // Like above, but de-virtualize the call to SerializeWithCachedSizes().  The
<span class="lineNum">     443 </span>            :   // pointer must point at an instance of MessageType, *not* a subclass (or
<span class="lineNum">     444 </span>            :   // the subclass must not override SerializeWithCachedSizes()).
<span class="lineNum">     445 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     446 </span>            :   static inline uint8* WriteGroupNoVirtualToArray(
<span class="lineNum">     447 </span>            :     field_number, const MessageType&amp; value, output) INL;
<span class="lineNum">     448 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     449 </span>            :   static inline uint8* WriteMessageNoVirtualToArray(
<span class="lineNum">     450 </span>            :     field_number, const MessageType&amp; value, output) INL;
<span class="lineNum">     451 </span>            : 
<span class="lineNum">     452 </span>            : #undef output
<span class="lineNum">     453 </span>            : #undef input
<span class="lineNum">     454 </span>            : #undef INL
<span class="lineNum">     455 </span>            : 
<span class="lineNum">     456 </span>            : #undef field_number
<span class="lineNum">     457 </span>            : 
<span class="lineNum">     458 </span>            :   // Compute the byte size of a field.  The XxSize() functions do NOT include
<span class="lineNum">     459 </span>            :   // the tag, so you must also call TagSize().  (This is because, for repeated
<span class="lineNum">     460 </span>            :   // fields, you should only call TagSize() once and multiply it by the element
<span class="lineNum">     461 </span>            :   // count, but you may have to call XxSize() for each individual element.)
<span class="lineNum">     462 </span>            :   static inline int Int32Size   ( int32 value);
<span class="lineNum">     463 </span>            :   static inline int Int64Size   ( int64 value);
<span class="lineNum">     464 </span>            :   static inline int UInt32Size  (uint32 value);
<span class="lineNum">     465 </span>            :   static inline int UInt64Size  (uint64 value);
<span class="lineNum">     466 </span>            :   static inline int SInt32Size  ( int32 value);
<span class="lineNum">     467 </span>            :   static inline int SInt64Size  ( int64 value);
<span class="lineNum">     468 </span>            :   static inline int EnumSize    (   int value);
<span class="lineNum">     469 </span>            : 
<span class="lineNum">     470 </span>            :   // These types always have the same size.
<span class="lineNum">     471 </span>            :   static const int kFixed32Size  = 4;
<span class="lineNum">     472 </span>            :   static const int kFixed64Size  = 8;
<span class="lineNum">     473 </span>            :   static const int kSFixed32Size = 4;
<span class="lineNum">     474 </span>            :   static const int kSFixed64Size = 8;
<span class="lineNum">     475 </span>            :   static const int kFloatSize    = 4;
<span class="lineNum">     476 </span>            :   static const int kDoubleSize   = 8;
<span class="lineNum">     477 </span>            :   static const int kBoolSize     = 1;
<span class="lineNum">     478 </span>            : 
<span class="lineNum">     479 </span>            :   static inline int StringSize(const string&amp; value);
<span class="lineNum">     480 </span>            :   static inline int BytesSize (const string&amp; value);
<span class="lineNum">     481 </span>            : 
<span class="lineNum">     482 </span>            :   static inline int GroupSize  (const MessageLite&amp; value);
<span class="lineNum">     483 </span>            :   static inline int MessageSize(const MessageLite&amp; value);
<span class="lineNum">     484 </span>            : 
<span class="lineNum">     485 </span>            :   // Like above, but de-virtualize the call to ByteSize().  The
<span class="lineNum">     486 </span>            :   // pointer must point at an instance of MessageType, *not* a subclass (or
<span class="lineNum">     487 </span>            :   // the subclass must not override ByteSize()).
<span class="lineNum">     488 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     489 </span>            :   static inline int GroupSizeNoVirtual  (const MessageType&amp; value);
<span class="lineNum">     490 </span>            :   template&lt;typename MessageType&gt;
<span class="lineNum">     491 </span>            :   static inline int MessageSizeNoVirtual(const MessageType&amp; value);
<span class="lineNum">     492 </span>            : 
<span class="lineNum">     493 </span>            :   // Given the length of data, calculate the byte size of the data on the
<span class="lineNum">     494 </span>            :   // wire if we encode the data as a length delimited field.
<span class="lineNum">     495 </span>            :   static inline int LengthDelimitedSize(int length);
<span class="lineNum">     496 </span>            : 
<span class="lineNum">     497 </span>            :  private:
<span class="lineNum">     498 </span>            :   // A helper method for the repeated primitive reader. This method has
<span class="lineNum">     499 </span>            :   // optimizations for primitive types that have fixed size on the wire, and
<span class="lineNum">     500 </span>            :   // can be read using potentially faster paths.
<span class="lineNum">     501 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     502 </span>            :   static inline bool ReadRepeatedFixedSizePrimitive(
<span class="lineNum">     503 </span>            :       int tag_size,
<span class="lineNum">     504 </span>            :       uint32 tag,
<span class="lineNum">     505 </span>            :       google::protobuf::io::CodedInputStream* input,
<span class="lineNum">     506 </span>            :       RepeatedField&lt;CType&gt;* value) GOOGLE_ATTRIBUTE_ALWAYS_INLINE;
<span class="lineNum">     507 </span>            : 
<span class="lineNum">     508 </span>            :   // Like ReadRepeatedFixedSizePrimitive but for packed primitive fields.
<span class="lineNum">     509 </span>            :   template &lt;typename CType, enum FieldType DeclaredType&gt;
<span class="lineNum">     510 </span>            :   static inline bool ReadPackedFixedSizePrimitive(
<span class="lineNum">     511 </span>            :       google::protobuf::io::CodedInputStream* input,
<span class="lineNum">     512 </span>            :       RepeatedField&lt;CType&gt;* value) GOOGLE_ATTRIBUTE_ALWAYS_INLINE;
<span class="lineNum">     513 </span>            : 
<span class="lineNum">     514 </span>            :   static const CppType kFieldTypeToCppTypeMap[];
<span class="lineNum">     515 </span>            :   static const WireFormatLite::WireType kWireTypeForFieldType[];
<span class="lineNum">     516 </span>            : 
<span class="lineNum">     517 </span>            :   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(WireFormatLite);
<span class="lineNum">     518 </span>            : };
<span class="lineNum">     519 </span>            : 
<span class="lineNum">     520 </span>            : // A class which deals with unknown values.  The default implementation just
<span class="lineNum">     521 </span>            : // discards them.  WireFormat defines a subclass which writes to an
<span class="lineNum">     522 </span>            : // UnknownFieldSet.  This class is used by ExtensionSet::ParseField(), since
<span class="lineNum">     523 </span>            : // ExtensionSet is part of the lite library but UnknownFieldSet is not.
<span class="lineNum">     524 </span>            : class LIBPROTOBUF_EXPORT FieldSkipper {
<span class="lineNum">     525 </span>            :  public:
<span class="lineNum">     526 </span>            :   FieldSkipper() {}
<span class="lineNum">     527 </span>            :   virtual ~FieldSkipper() {}
<span class="lineNum">     528 </span>            : 
<span class="lineNum">     529 </span>            :   // Skip a field whose tag has already been consumed.
<span class="lineNum">     530 </span>            :   virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
<span class="lineNum">     531 </span>            : 
<span class="lineNum">     532 </span>            :   // Skip an entire message or group, up to an end-group tag (which is consumed)
<span class="lineNum">     533 </span>            :   // or end-of-stream.
<span class="lineNum">     534 </span>            :   virtual bool SkipMessage(io::CodedInputStream* input);
<span class="lineNum">     535 </span>            : 
<span class="lineNum">     536 </span>            :   // Deal with an already-parsed unrecognized enum value.  The default
<span class="lineNum">     537 </span>            :   // implementation does nothing, but the UnknownFieldSet-based implementation
<span class="lineNum">     538 </span>            :   // saves it as an unknown varint.
<span class="lineNum">     539 </span>            :   virtual void SkipUnknownEnum(int field_number, int value);
<span class="lineNum">     540 </span>            : };
<span class="lineNum">     541 </span>            : 
<span class="lineNum">     542 </span>            : // Subclass of FieldSkipper which saves skipped fields to a CodedOutputStream.
<span class="lineNum">     543 </span>            : 
<span class="lineNum">     544 </span>            : class LIBPROTOBUF_EXPORT CodedOutputStreamFieldSkipper : public FieldSkipper {
<span class="lineNum">     545 </span>            :  public:
<span class="lineNum">     546 </span>            :   explicit CodedOutputStreamFieldSkipper(io::CodedOutputStream* unknown_fields)
<span class="lineNum">     547 </span>            :       : unknown_fields_(unknown_fields) {}
<span class="lineNum">     548 </span>            :   virtual ~CodedOutputStreamFieldSkipper() {}
<span class="lineNum">     549 </span>            : 
<span class="lineNum">     550 </span>            :   // implements FieldSkipper -----------------------------------------
<span class="lineNum">     551 </span>            :   virtual bool SkipField(io::CodedInputStream* input, uint32 tag);
<span class="lineNum">     552 </span>            :   virtual bool SkipMessage(io::CodedInputStream* input);
<span class="lineNum">     553 </span>            :   virtual void SkipUnknownEnum(int field_number, int value);
<span class="lineNum">     554 </span>            : 
<span class="lineNum">     555 </span>            :  protected:
<span class="lineNum">     556 </span>            :   io::CodedOutputStream* unknown_fields_;
<span class="lineNum">     557 </span>            : };
<span class="lineNum">     558 </span>            : 
<span class="lineNum">     559 </span>            : 
<span class="lineNum">     560 </span>            : // inline methods ====================================================
<span class="lineNum">     561 </span>            : 
<span class="lineNum">     562 </span>            : inline WireFormatLite::CppType
<span class="lineNum">     563 </span>            : WireFormatLite::FieldTypeToCppType(FieldType type) {
<span class="lineNum">     564 </span>            :   return kFieldTypeToCppTypeMap[type];
<span class="lineNum">     565 </span>            : }
<span class="lineNum">     566 </span>            : 
<span class="lineNum">     567 </span>            : inline uint32 WireFormatLite::MakeTag(int field_number, WireType type) {
<span class="lineNum">     568 </span>            :   return GOOGLE_PROTOBUF_WIRE_FORMAT_MAKE_TAG(field_number, type);
<span class="lineNum">     569 </span>            : }
<span class="lineNum">     570 </span>            : 
<span class="lineNum">     571 </span>            : inline WireFormatLite::WireType WireFormatLite::GetTagWireType(uint32 tag) {
<span class="lineNum">     572 </span><span class="lineNoCov">          0 :   return static_cast&lt;WireType&gt;(tag &amp; kTagTypeMask);</span>
<span class="lineNum">     573 </span>            : }
<span class="lineNum">     574 </span>            : 
<span class="lineNum">     575 </span>            : inline int WireFormatLite::GetTagFieldNumber(uint32 tag) {
<span class="lineNum">     576 </span><span class="lineCov">      10392 :   return static_cast&lt;int&gt;(tag &gt;&gt; kTagTypeBits);</span>
<span class="lineNum">     577 </span>            : }
<span class="lineNum">     578 </span>            : 
<span class="lineNum">     579 </span>            : inline int WireFormatLite::TagSize(int field_number,
<span class="lineNum">     580 </span>            :                                    WireFormatLite::FieldType type) {
<span class="lineNum">     581 </span>            :   int result = io::CodedOutputStream::VarintSize32(
<span class="lineNum">     582 </span>            :     field_number &lt;&lt; kTagTypeBits);
<span class="lineNum">     583 </span>            :   if (type == TYPE_GROUP) {
<span class="lineNum">     584 </span>            :     // Groups have both a start and an end tag.
<span class="lineNum">     585 </span>            :     return result * 2;
<span class="lineNum">     586 </span>            :   } else {
<span class="lineNum">     587 </span>            :     return result;
<span class="lineNum">     588 </span>            :   }
<span class="lineNum">     589 </span>            : }
<span class="lineNum">     590 </span>            : 
<span class="lineNum">     591 </span>            : inline uint32 WireFormatLite::EncodeFloat(float value) {
<span class="lineNum">     592 </span>            :   union {float f; uint32 i;};
<span class="lineNum">     593 </span>            :   f = value;
<span class="lineNum">     594 </span><span class="lineNoCov">          0 :   return i;</span>
<span class="lineNum">     595 </span>            : }
<span class="lineNum">     596 </span>            : 
<span class="lineNum">     597 </span>            : inline float WireFormatLite::DecodeFloat(uint32 value) {
<span class="lineNum">     598 </span>            :   union {float f; uint32 i;};
<span class="lineNum">     599 </span><span class="lineCov">         10 :   i = value;</span>
<span class="lineNum">     600 </span>            :   return f;
<span class="lineNum">     601 </span>            : }
<span class="lineNum">     602 </span>            : 
<span class="lineNum">     603 </span>            : inline uint64 WireFormatLite::EncodeDouble(double value) {
<span class="lineNum">     604 </span>            :   union {double f; uint64 i;};
<span class="lineNum">     605 </span>            :   f = value;
<span class="lineNum">     606 </span><span class="lineNoCov">          0 :   return i;</span>
<span class="lineNum">     607 </span>            : }
<span class="lineNum">     608 </span>            : 
<span class="lineNum">     609 </span>            : inline double WireFormatLite::DecodeDouble(uint64 value) {
<span class="lineNum">     610 </span>            :   union {double f; uint64 i;};
<span class="lineNum">     611 </span><span class="lineNoCov">          0 :   i = value;</span>
<span class="lineNum">     612 </span>            :   return f;
<span class="lineNum">     613 </span>            : }
<span class="lineNum">     614 </span>            : 
<span class="lineNum">     615 </span>            : // ZigZag Transform:  Encodes signed integers so that they can be
<span class="lineNum">     616 </span>            : // effectively used with varint encoding.
<span class="lineNum">     617 </span>            : //
<span class="lineNum">     618 </span>            : // varint operates on unsigned integers, encoding smaller numbers into
<span class="lineNum">     619 </span>            : // fewer bytes.  If you try to use it on a signed integer, it will treat
<span class="lineNum">     620 </span>            : // this number as a very large unsigned integer, which means that even
<span class="lineNum">     621 </span>            : // small signed numbers like -1 will take the maximum number of bytes
<span class="lineNum">     622 </span>            : // (10) to encode.  ZigZagEncode() maps signed integers to unsigned
<span class="lineNum">     623 </span>            : // in such a way that those with a small absolute value will have smaller
<span class="lineNum">     624 </span>            : // encoded values, making them appropriate for encoding using varint.
<span class="lineNum">     625 </span>            : //
<span class="lineNum">     626 </span>            : //       int32 -&gt;     uint32
<span class="lineNum">     627 </span>            : // -------------------------
<span class="lineNum">     628 </span>            : //           0 -&gt;          0
<span class="lineNum">     629 </span>            : //          -1 -&gt;          1
<span class="lineNum">     630 </span>            : //           1 -&gt;          2
<span class="lineNum">     631 </span>            : //          -2 -&gt;          3
<span class="lineNum">     632 </span>            : //         ... -&gt;        ...
<span class="lineNum">     633 </span>            : //  2147483647 -&gt; 4294967294
<span class="lineNum">     634 </span>            : // -2147483648 -&gt; 4294967295
<span class="lineNum">     635 </span>            : //
<span class="lineNum">     636 </span>            : //        &gt;&gt; encode &gt;&gt;
<span class="lineNum">     637 </span>            : //        &lt;&lt; decode &lt;&lt;
<span class="lineNum">     638 </span>            : 
<span class="lineNum">     639 </span>            : inline uint32 WireFormatLite::ZigZagEncode32(int32 n) {
<span class="lineNum">     640 </span>            :   // Note:  the right-shift must be arithmetic
<span class="lineNum">     641 </span>            :   return (n &lt;&lt; 1) ^ (n &gt;&gt; 31);
<span class="lineNum">     642 </span>            : }
<span class="lineNum">     643 </span>            : 
<span class="lineNum">     644 </span>            : inline int32 WireFormatLite::ZigZagDecode32(uint32 n) {
<span class="lineNum">     645 </span>            :   return (n &gt;&gt; 1) ^ -static_cast&lt;int32&gt;(n &amp; 1);
<span class="lineNum">     646 </span>            : }
<span class="lineNum">     647 </span>            : 
<span class="lineNum">     648 </span>            : inline uint64 WireFormatLite::ZigZagEncode64(int64 n) {
<span class="lineNum">     649 </span>            :   // Note:  the right-shift must be arithmetic
<span class="lineNum">     650 </span>            :   return (n &lt;&lt; 1) ^ (n &gt;&gt; 63);
<span class="lineNum">     651 </span>            : }
<span class="lineNum">     652 </span>            : 
<span class="lineNum">     653 </span>            : inline int64 WireFormatLite::ZigZagDecode64(uint64 n) {
<span class="lineNum">     654 </span>            :   return (n &gt;&gt; 1) ^ -static_cast&lt;int64&gt;(n &amp; 1);
<span class="lineNum">     655 </span>            : }
<span class="lineNum">     656 </span>            : 
<span class="lineNum">     657 </span>            : }  // namespace internal
<span class="lineNum">     658 </span>            : }  // namespace protobuf
<span class="lineNum">     659 </span>            : 
<span class="lineNum">     660 </span>            : }  // namespace google
<span class="lineNum">     661 </span>            : #endif  // GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_H__
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.12</a></td></tr>
  </table>
  <br>

</body>
</html>
